package org.testis.logging;

import org.testis.utils.DateUtils;


/**
 *
 * @author nurhat
 */
public class LogHeaderData extends LogData
{

    private static final long serialVersionUID = 19820003L;
    private int m_designTreeId;
    private int m_designPartType;
    private Byte m_result;
    private int m_parentId;
    private String m_name;
    private String m_executionGuid;
    private String m_parentGuid;


    public LogHeaderData(int designTreeId,
                         int designPartType,
                         Byte result,
                         int parentId,
                         String name,
                         String guid)
    {
        setDesignPartType(designPartType);
        setDesignTreeId(designTreeId);
        setGuid(guid);
        setName(name);
        setParentId(parentId);
        setResult(result);
        setExecutionGuid("");
        try {
            this.m_date =
                DateUtils.now("dd.MM.yy  hh:mm:ss");
        } catch (Exception ex) {
        }
    }


    public LogHeaderData(int designTreeId,
                         int designPartType,
                         Byte result,
                         int parentId,
                         String name,
                         String guid,
                         String executionGuid)
    {
        setDesignPartType(designPartType);
        setDesignTreeId(designTreeId);
        setGuid(guid);
        setName(name);
        setParentId(parentId);
        setResult(result);
        setExecutionGuid(executionGuid);
        try {
            this.m_date =
                DateUtils.now("dd.MM.yy  hh:mm:ss");
        } catch (Exception ex) {
        }
    }


    public LogHeaderData(int designTreeId,
                         int designPartType,
                         Byte result,
                         String parentGuid,
                         String name,
                         String guid,
                         String executionGuid)
    {
        setDesignPartType(designPartType);
        setDesignTreeId(designTreeId);
        setGuid(guid);
        setName(name);
        setParentGuid(parentGuid);
        setResult(result);
        setExecutionGuid(executionGuid);
        try {
            this.m_date =
                DateUtils.now("dd.MM.yy  hh:mm:ss");
        } catch (Exception ex) {
        }
    }


    public int getDesignTreeId()
    {
        return m_designTreeId;
    }


    public void setDesignTreeId(int designTreeId)
    {
        this.m_designTreeId = designTreeId;
    }


    public int getDesignPartType()
    {
        return m_designPartType;
    }


    public void setDesignPartType(int designPartType)
    {
        this.m_designPartType = designPartType;
    }


    public Byte getResult()
    {
        return m_result;
    }


    public void setResult(Byte result)
    {
        this.m_result = result;
    }


    public int getParentId()
    {
        return m_parentId;
    }


    public void setParentId(int parentId)
    {
        this.m_parentId = parentId;
    }


    public String getName()
    {
        return m_name;
    }


    public void setName(String name)
    {
        this.m_name = name;
    }


    @Override
    public void printMessage()
    {
        System.out.println("Part Name:" + getName() + " Result:" + getResult() +
                           " Date:" + getDate());
    }


    @Override
    public String getPrintMessage()
    {
        return "Part Name:" + getName() + " Result:" + getResult() +
            " Date:" + getDate();
    }


    public String getExecutionGuid()
    {
        return m_executionGuid;
    }


    public void setExecutionGuid(String m_executionGuid)
    {
        this.m_executionGuid = m_executionGuid;
    }


    public String getParentGuid()
    {
        return m_parentGuid;
    }


    public void setParentGuid(String m_parentGuid)
    {
        this.m_parentGuid = m_parentGuid;
    }
}
